import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询告警规则列表
 * @param query
 * @returns {*}
 */

export const list = (query) => {
  return request({
    url: '/biz-station/alarmRule/list',
    method: 'get',
    params: query
  });
};

/**
 * 获取告警规则详细信息
 * @param id
 */
export const info = (id: string | number) => {
  return request({
    url: '/biz-station/alarmRule/' + id,
    method: 'get'
  });
};

/**
 * 查询告警配置列表
 * @param query 
 * @returns 
 */
export const confList = (query) => {
  return request({
    url: '/biz-station/alarmRule/conf/list',
    method: 'get',
    params: query
  });
};

/**
 * 获取告警配置详细信息
 * @param id
 */
export const confInfo = (id: string | number) => {
  return request({
    url: '/biz-station/alarmRule/conf/' + id,
    method: 'get'
  });
};



/**
 * 新增
 * @param data
 */
export const add = (data) => {
  return request({
    url: '/biz-station/alarmRule',
    method: 'post',
    data: data
  });
};

/**
 * 编辑
 * @param data
 */
export const update = (data) => {
  return request({
    url: '/biz-station/alarmRule',
    method: 'put',
    data: data
  });
};


/**
 * 删除
 * @param ids
 */
export const del = (ids: Array<string | number>) => {
  return request({
    url: '/biz-station/alarmRule/' + ids,
    method: 'delete'
  });
};

/**
 * 新增告警配置
 * @param data
 */
export const confAdd = (data) => {
  return request({
    url: '/biz-station/alarmRule/conf',
    method: 'post',
    data: data
  });
};

/**
 * 修改告警配置
 * @param data
 */
export const confUpdate = (data) => {
  return request({
    url: '/biz-station/alarmRule/conf',
    method: 'put',
    data: data
  });
};


/**
 * 删除告警配置
 * @param ids
 */
export const confDel = (ids: Array<string | number>) => {
  return request({
    url: '/biz-station/alarmRule/conf/' + ids,
    method: 'delete'
  });
};

